﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form5 : Form
    {
        public Form5()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var id = this.textBox1.Text;
            var bookName = this.bookName.Text;
            var peopleName = this.peopleName.Text;
            var time = this.time.Text;
            DbHelper db = new DbHelper();
            string gengxing = string.Format("update Articles set Title='{0}',Author='{1}',CreatedTime={2} where Id={3}", bookName, peopleName, time, id);
            db.ExecuteNonQuery(gengxing);
            MessageBox.Show("信息更新成功");
            this.Close();
        }

        private void label4_Click(object sender, EventArgs e)
        {

        }
    }
}
